package com.ldp.designpatterns.study.proxy.service;

/**
 * @ClassName RealImage
 * @Description TODO: 被代理对象的实现类
 * @Author lindipei
 * @Date 2023/10/17 17:30
 */
public class RealImage implements Image {
    private String filename;

    public RealImage(String filename) {
        this.filename = filename;
        loadImageFromDisk();
    }

    private void loadImageFromDisk() {
        System.out.println("Loading image from disk: " + filename);
    }

    @Override
    public void display() {
        System.out.println("Displaying image: " + filename);
    }
}
